blob: c05193cb2befc5fcb46ebd684b55e45e038d6b4d [file] [log] [blame]
Junio C Hamanod9d71c02006-02-08 00:52:331<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
2 "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
4<head>
5<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
Junio C Hamano68cf15a2010-11-06 01:01:596<meta name="generator" content="AsciiDoc 8.4.5" />
7<title>git-show(1)</title>
Junio C Hamanod9d71c02006-02-08 00:52:338<style type="text/css">
9/* Debug borders */
10p, li, dt, dd, div, pre, h1, h2, h3, h4, h5, h6 {
11/*
12 border: 1px solid red;
13*/
14}
15
16body {
17 margin: 1em 5% 1em 5%;
18}
19
Junio C Hamanoba4b9282008-07-06 05:20:3120a {
21 color: blue;
22 text-decoration: underline;
23}
24a:visited {
25 color: fuchsia;
26}
Junio C Hamanod9d71c02006-02-08 00:52:3327
28em {
29 font-style: italic;
Junio C Hamano68cf15a2010-11-06 01:01:5930 color: navy;
Junio C Hamanod9d71c02006-02-08 00:52:3331}
32
33strong {
34 font-weight: bold;
Junio C Hamano68cf15a2010-11-06 01:01:5935 color: #083194;
Junio C Hamanod9d71c02006-02-08 00:52:3336}
37
38tt {
39 color: navy;
40}
41
42h1, h2, h3, h4, h5, h6 {
43 color: #527bbd;
44 font-family: sans-serif;
45 margin-top: 1.2em;
46 margin-bottom: 0.5em;
47 line-height: 1.3;
48}
49
Junio C Hamanoba4b9282008-07-06 05:20:3150h1, h2, h3 {
Junio C Hamanod9d71c02006-02-08 00:52:3351 border-bottom: 2px solid silver;
52}
53h2 {
Junio C Hamanod9d71c02006-02-08 00:52:3354 padding-top: 0.5em;
55}
Junio C Hamanoba4b9282008-07-06 05:20:3156h3 {
57 float: left;
58}
59h3 + * {
60 clear: left;
61}
Junio C Hamanod9d71c02006-02-08 00:52:3362
63div.sectionbody {
64 font-family: serif;
65 margin-left: 0;
66}
67
68hr {
69 border: 1px solid silver;
70}
71
72p {
73 margin-top: 0.5em;
74 margin-bottom: 0.5em;
75}
76
Junio C Hamano68cf15a2010-11-06 01:01:5977ul, ol, li > p {
78 margin-top: 0;
79}
80
Junio C Hamanod9d71c02006-02-08 00:52:3381pre {
82 padding: 0;
83 margin: 0;
84}
85
86span#author {
87 color: #527bbd;
88 font-family: sans-serif;
89 font-weight: bold;
Junio C Hamanoba4b9282008-07-06 05:20:3190 font-size: 1.1em;
Junio C Hamanod9d71c02006-02-08 00:52:3391}
92span#email {
93}
Junio C Hamano68cf15a2010-11-06 01:01:5994span#revnumber, span#revdate, span#revremark {
Junio C Hamanod9d71c02006-02-08 00:52:3395 font-family: sans-serif;
96}
97
98div#footer {
99 font-family: sans-serif;
100 font-size: small;
101 border-top: 2px solid silver;
102 padding-top: 0.5em;
103 margin-top: 4.0em;
104}
105div#footer-text {
106 float: left;
107 padding-bottom: 0.5em;
108}
109div#footer-badges {
110 float: right;
111 padding-bottom: 0.5em;
112}
113
Junio C Hamano68cf15a2010-11-06 01:01:59114div#preamble {
115 margin-top: 1.5em;
116 margin-bottom: 1.5em;
117}
Junio C Hamanod9d71c02006-02-08 00:52:33118div.tableblock, div.imageblock, div.exampleblock, div.verseblock,
119div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
120div.admonitionblock {
Junio C Hamanod9d71c02006-02-08 00:52:33121 margin-top: 1.5em;
122 margin-bottom: 1.5em;
123}
124div.admonitionblock {
125 margin-top: 2.5em;
126 margin-bottom: 2.5em;
127}
128
129div.content { /* Block element content. */
130 padding: 0;
131}
132
133/* Block element titles. */
134div.title, caption.title {
Junio C Hamano68cf15a2010-11-06 01:01:59135 color: #527bbd;
Junio C Hamanod9d71c02006-02-08 00:52:33136 font-family: sans-serif;
137 font-weight: bold;
138 text-align: left;
139 margin-top: 1.0em;
140 margin-bottom: 0.5em;
141}
142div.title + * {
143 margin-top: 0;
144}
145
146td div.title:first-child {
147 margin-top: 0.0em;
148}
149div.content div.title:first-child {
150 margin-top: 0.0em;
151}
152div.content + div.title {
153 margin-top: 0.0em;
154}
155
156div.sidebarblock > div.content {
157 background: #ffffee;
158 border: 1px solid silver;
159 padding: 0.5em;
160}
161
162div.listingblock > div.content {
163 border: 1px solid silver;
164 background: #f4f4f4;
165 padding: 0.5em;
166}
167
Junio C Hamano68cf15a2010-11-06 01:01:59168div.quoteblock {
Junio C Hamanod9d71c02006-02-08 00:52:33169 padding-left: 2.0em;
Junio C Hamano68cf15a2010-11-06 01:01:59170 margin-right: 10%;
Junio C Hamanod9d71c02006-02-08 00:52:33171}
Junio C Hamano68cf15a2010-11-06 01:01:59172div.quoteblock > div.attribution {
173 padding-top: 0.5em;
Junio C Hamanod9d71c02006-02-08 00:52:33174 text-align: right;
175}
Junio C Hamano68cf15a2010-11-06 01:01:59176
177div.verseblock {
178 padding-left: 2.0em;
179 margin-right: 10%;
180}
181div.verseblock > div.content {
182 white-space: pre;
183}
184div.verseblock > div.attribution {
185 padding-top: 0.75em;
186 text-align: left;
187}
188/* DEPRECATED: Pre version 8.2.7 verse style literal block. */
Junio C Hamanoba4b9282008-07-06 05:20:31189div.verseblock + div.attribution {
190 text-align: left;
191}
Junio C Hamanod9d71c02006-02-08 00:52:33192
193div.admonitionblock .icon {
194 vertical-align: top;
195 font-size: 1.1em;
196 font-weight: bold;
197 text-decoration: underline;
198 color: #527bbd;
199 padding-right: 0.5em;
200}
201div.admonitionblock td.content {
202 padding-left: 0.5em;
203 border-left: 2px solid silver;
204}
205
206div.exampleblock > div.content {
207 border-left: 2px solid silver;
208 padding: 0.5em;
209}
210
Junio C Hamanod9d71c02006-02-08 00:52:33211div.imageblock div.content { padding-left: 0; }
Junio C Hamanod9d71c02006-02-08 00:52:33212span.image img { border-style: none; }
Junio C Hamano68cf15a2010-11-06 01:01:59213a.image:visited { color: white; }
Junio C Hamanod9d71c02006-02-08 00:52:33214
215dl {
216 margin-top: 0.8em;
217 margin-bottom: 0.8em;
218}
219dt {
220 margin-top: 0.5em;
221 margin-bottom: 0;
Junio C Hamano68cf15a2010-11-06 01:01:59222 font-style: normal;
223 color: navy;
Junio C Hamanod9d71c02006-02-08 00:52:33224}
225dd > *:first-child {
Junio C Hamano68cf15a2010-11-06 01:01:59226 margin-top: 0.1em;
Junio C Hamanod9d71c02006-02-08 00:52:33227}
228
229ul, ol {
230 list-style-position: outside;
231}
Junio C Hamano68cf15a2010-11-06 01:01:59232ol.arabic {
233 list-style-type: decimal;
234}
235ol.loweralpha {
Junio C Hamanod9d71c02006-02-08 00:52:33236 list-style-type: lower-alpha;
237}
Junio C Hamano68cf15a2010-11-06 01:01:59238ol.upperalpha {
239 list-style-type: upper-alpha;
240}
241ol.lowerroman {
242 list-style-type: lower-roman;
243}
244ol.upperroman {
245 list-style-type: upper-roman;
246}
247
248div.compact ul, div.compact ol,
249div.compact p, div.compact p,
250div.compact div, div.compact div {
251 margin-top: 0.1em;
252 margin-bottom: 0.1em;
253}
Junio C Hamanod9d71c02006-02-08 00:52:33254
255div.tableblock > table {
Junio C Hamanoba4b9282008-07-06 05:20:31256 border: 3px solid #527bbd;
Junio C Hamanod9d71c02006-02-08 00:52:33257}
258thead {
259 font-family: sans-serif;
260 font-weight: bold;
261}
262tfoot {
263 font-weight: bold;
264}
Junio C Hamano68cf15a2010-11-06 01:01:59265td > div.verse {
266 white-space: pre;
267}
268p.table {
269 margin-top: 0;
270}
271/* Because the table frame attribute is overriden by CSS in most browsers. */
272div.tableblock > table[frame="void"] {
273 border-style: none;
274}
275div.tableblock > table[frame="hsides"] {
276 border-left-style: none;
277 border-right-style: none;
278}
279div.tableblock > table[frame="vsides"] {
280 border-top-style: none;
281 border-bottom-style: none;
282}
Junio C Hamanod9d71c02006-02-08 00:52:33283
Junio C Hamano68cf15a2010-11-06 01:01:59284
285div.hdlist {
Junio C Hamanod9d71c02006-02-08 00:52:33286 margin-top: 0.8em;
287 margin-bottom: 0.8em;
288}
Junio C Hamano68cf15a2010-11-06 01:01:59289div.hdlist tr {
290 padding-bottom: 15px;
Junio C Hamanoba4b9282008-07-06 05:20:31291}
Junio C Hamano68cf15a2010-11-06 01:01:59292dt.hdlist1.strong, td.hdlist1.strong {
293 font-weight: bold;
294}
295td.hdlist1 {
Junio C Hamanod9d71c02006-02-08 00:52:33296 vertical-align: top;
Junio C Hamano68cf15a2010-11-06 01:01:59297 font-style: normal;
Junio C Hamanod9d71c02006-02-08 00:52:33298 padding-right: 0.8em;
Junio C Hamano68cf15a2010-11-06 01:01:59299 color: navy;
Junio C Hamanod9d71c02006-02-08 00:52:33300}
Junio C Hamano68cf15a2010-11-06 01:01:59301td.hdlist2 {
Junio C Hamanod9d71c02006-02-08 00:52:33302 vertical-align: top;
303}
Junio C Hamano68cf15a2010-11-06 01:01:59304div.hdlist.compact tr {
305 margin: 0;
306 padding-bottom: 0;
307}
308
309.comment {
310 background: yellow;
311}
Junio C Hamanod9d71c02006-02-08 00:52:33312
313@media print {
314 div#footer-badges { display: none; }
315}
Junio C Hamanoba4b9282008-07-06 05:20:31316
317div#toctitle {
318 color: #527bbd;
319 font-family: sans-serif;
320 font-size: 1.1em;
321 font-weight: bold;
322 margin-top: 1.0em;
323 margin-bottom: 0.1em;
324}
325
326div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
327 margin-top: 0;
328 margin-bottom: 0;
329}
330div.toclevel2 {
331 margin-left: 2em;
332 font-size: 0.9em;
333}
334div.toclevel3 {
335 margin-left: 4em;
336 font-size: 0.9em;
337}
338div.toclevel4 {
339 margin-left: 6em;
340 font-size: 0.9em;
341}
Junio C Hamano68cf15a2010-11-06 01:01:59342/* Overrides for manpage documents */
343h1 {
344 padding-top: 0.5em;
345 padding-bottom: 0.5em;
346 border-top: 2px solid silver;
347 border-bottom: 2px solid silver;
348}
349h2 {
350 border-style: none;
351}
352div.sectionbody {
353 margin-left: 5%;
354}
355
356@media print {
357 div#toc { display: none; }
358}
359
Junio C Hamanod9d71c02006-02-08 00:52:33360/* Workarounds for IE6's broken and incomplete CSS2. */
361
362div.sidebar-content {
363 background: #ffffee;
364 border: 1px solid silver;
365 padding: 0.5em;
366}
367div.sidebar-title, div.image-title {
Junio C Hamano68cf15a2010-11-06 01:01:59368 color: #527bbd;
Junio C Hamanod9d71c02006-02-08 00:52:33369 font-family: sans-serif;
370 font-weight: bold;
371 margin-top: 0.0em;
372 margin-bottom: 0.5em;
373}
374
375div.listingblock div.content {
376 border: 1px solid silver;
377 background: #f4f4f4;
378 padding: 0.5em;
379}
380
Junio C Hamano68cf15a2010-11-06 01:01:59381div.quoteblock-attribution {
382 padding-top: 0.5em;
383 text-align: right;
384}
385
386div.verseblock-content {
387 white-space: pre;
388}
389div.verseblock-attribution {
390 padding-top: 0.75em;
391 text-align: left;
Junio C Hamanod9d71c02006-02-08 00:52:33392}
393
394div.exampleblock-content {
395 border-left: 2px solid silver;
396 padding-left: 0.5em;
397}
Junio C Hamanoba4b9282008-07-06 05:20:31398
399/* IE6 sets dynamically generated links as visited. */
400div#toc a:visited { color: blue; }
Junio C Hamanod9d71c02006-02-08 00:52:33401</style>
Junio C Hamanod9d71c02006-02-08 00:52:33402</head>
403<body>
404<div id="header">
405<h1>
406git-show(1) Manual Page
407</h1>
408<h2>NAME</h2>
409<div class="sectionbody">
410<p>git-show -
Junio C Hamano7d23f5e2006-12-16 07:44:04411 Show various types of objects
Junio C Hamanod9d71c02006-02-08 00:52:33412</p>
413</div>
414</div>
Junio C Hamano68cf15a2010-11-06 01:01:59415<h2 id="_synopsis">SYNOPSIS</h2>
Junio C Hamanod9d71c02006-02-08 00:52:33416<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:59417<div class="paragraph"><p><em>git show</em> [options] &lt;object&gt;&#8230;</p></div>
Junio C Hamanod9d71c02006-02-08 00:52:33418</div>
Junio C Hamanoba4b9282008-07-06 05:20:31419<h2 id="_description">DESCRIPTION</h2>
Junio C Hamanod9d71c02006-02-08 00:52:33420<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:59421<div class="paragraph"><p>Shows one or more objects (blobs, trees, tags and commits).</p></div>
422<div class="paragraph"><p>For commits it shows the log message and textual diff. It also
Junio C Hamano7d23f5e2006-12-16 07:44:04423presents the merge commit in a special format as produced by
Junio C Hamano1aa40d22010-01-21 17:46:43424<em>git diff-tree --cc</em>.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:59425<div class="paragraph"><p>For tags, it shows the tag message and the referenced objects.</p></div>
426<div class="paragraph"><p>For trees, it shows the names (equivalent to <em>git ls-tree</em>
Junio C Hamanoba4b9282008-07-06 05:20:31427with --name-only).</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:59428<div class="paragraph"><p>For plain blobs, it shows the plain contents.</p></div>
429<div class="paragraph"><p>The command takes options applicable to the <em>git diff-tree</em> command to
Junio C Hamanoba4b9282008-07-06 05:20:31430control how the changes the commit introduces are shown.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:59431<div class="paragraph"><p>This manual page describes only the most frequently used options.</p></div>
Junio C Hamanod9d71c02006-02-08 00:52:33432</div>
Junio C Hamanoba4b9282008-07-06 05:20:31433<h2 id="_options">OPTIONS</h2>
Junio C Hamanod9d71c02006-02-08 00:52:33434<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:59435<div class="dlist"><dl>
436<dt class="hdlist1">
Junio C Hamano9e395072008-07-31 22:11:21437&lt;object&gt;&#8230;
Junio C Hamanod9d71c02006-02-08 00:52:33438</dt>
439<dd>
440<p>
Junio C Hamano9e395072008-07-31 22:11:21441 The names of objects to show.
Junio C Hamano2d47c622007-01-18 06:24:10442 For a more complete list of ways to spell object names, see
Junio C Hamanoc27b7332010-10-14 04:37:28443 "SPECIFYING REVISIONS" section in <a href="gitrevisions.html">gitrevisions(7)</a>.
Junio C Hamanod9d71c02006-02-08 00:52:33444</p>
445</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59446<dt class="hdlist1">
Junio C Hamanod2179ef2010-10-22 04:12:17447--pretty[=&lt;format&gt;]
Junio C Hamanod9d71c02006-02-08 00:52:33448</dt>
Junio C Hamano68cf15a2010-11-06 01:01:59449<dt class="hdlist1">
Junio C Hamanod2179ef2010-10-22 04:12:17450--format=&lt;format&gt;
Junio C Hamano0a235222009-03-06 08:21:09451</dt>
Junio C Hamanod9d71c02006-02-08 00:52:33452<dd>
453<p>
Junio C Hamanoa3770f92007-07-25 08:53:33454 Pretty-print the contents of the commit logs in a given format,
Junio C Hamano0430e3a2007-05-15 03:13:17455 where <em>&lt;format&gt;</em> can be one of <em>oneline</em>, <em>short</em>, <em>medium</em>,
Junio C Hamanoe32ec8b2010-06-02 23:32:31456 <em>full</em>, <em>fuller</em>, <em>email</em>, <em>raw</em> and <em>format:&lt;string&gt;</em>. See
457 the "PRETTY FORMATS" section for some additional details for each
458 format. When omitted, the format defaults to <em>medium</em>.
Junio C Hamanod9d71c02006-02-08 00:52:33459</p>
Junio C Hamano68cf15a2010-11-06 01:01:59460<div class="paragraph"><p>Note: you can specify the default pretty format in the repository
Junio C Hamanoba4b9282008-07-06 05:20:31461configuration (see <a href="git-config.html">git-config(1)</a>).</p></div>
Junio C Hamano0430e3a2007-05-15 03:13:17462</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59463<dt class="hdlist1">
Junio C Hamanoee695f22007-06-21 00:35:36464--abbrev-commit
465</dt>
466<dd>
467<p>
468 Instead of showing the full 40-byte hexadecimal commit object
Junio C Hamano6efe3022009-01-13 16:47:56469 name, show only a partial prefix. Non default number of
Junio C Hamanoee695f22007-06-21 00:35:36470 digits can be specified with "--abbrev=&lt;n&gt;" (which also modifies
471 diff output, if it is displayed).
472</p>
Junio C Hamano68cf15a2010-11-06 01:01:59473<div class="paragraph"><p>This should make "--pretty=oneline" a whole lot more readable for
Junio C Hamanoba4b9282008-07-06 05:20:31474people using 80-column terminals.</p></div>
Junio C Hamanoee695f22007-06-21 00:35:36475</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59476<dt class="hdlist1">
Junio C Hamano0a235222009-03-06 08:21:09477--oneline
478</dt>
479<dd>
480<p>
481 This is a shorthand for "--pretty=oneline --abbrev-commit"
482 used together.
483</p>
484</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59485<dt class="hdlist1">
Junio C Hamano0430e3a2007-05-15 03:13:17486--encoding[=&lt;encoding&gt;]
487</dt>
488<dd>
489<p>
490 The commit objects record the encoding used for the log message
491 in their encoding header; this option can be used to tell the
492 command to re-code the commit log message in the encoding
493 preferred by the user. For non plumbing commands this
494 defaults to UTF-8.
495</p>
496</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59497<dt class="hdlist1">
Junio C Hamano57827fb2010-01-23 03:02:50498--no-notes
499</dt>
Junio C Hamano68cf15a2010-11-06 01:01:59500<dt class="hdlist1">
Junio C Hamano31667362010-03-25 00:38:53501--show-notes[=&lt;ref&gt;]
Junio C Hamano57827fb2010-01-23 03:02:50502</dt>
503<dd>
504<p>
505 Show the notes (see <a href="git-notes.html">git-notes(1)</a>) that annotate the
506 commit, when showing the commit log message. This is the default
507 for <tt>git log</tt>, <tt>git show</tt> and <tt>git whatchanged</tt> commands when
508 there is no <tt>--pretty</tt>, <tt>--format</tt> nor <tt>--oneline</tt> option is
509 given on the command line.
510</p>
Junio C Hamano68cf15a2010-11-06 01:01:59511<div class="paragraph"><p>With an optional argument, add this ref to the list of notes. The ref
Junio C Hamano31667362010-03-25 00:38:53512is taken to be in <tt>refs/notes/</tt> if it is not qualified.</p></div>
513</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59514<dt class="hdlist1">
Junio C Hamano31667362010-03-25 00:38:53515--[no-]standard-notes
516</dt>
517<dd>
518<p>
519 Enable or disable populating the notes ref list from the
520 <em>core.notesRef</em> and <em>notes.displayRef</em> variables (or
521 corresponding environment overrides). Enabled by default.
522 See <a href="git-config.html">git-config(1)</a>.
523</p>
Junio C Hamano57827fb2010-01-23 03:02:50524</dd>
Junio C Hamanoba4b9282008-07-06 05:20:31525</dl></div>
Junio C Hamano0430e3a2007-05-15 03:13:17526</div>
Junio C Hamanoba4b9282008-07-06 05:20:31527<h2 id="_pretty_formats">PRETTY FORMATS</h2>
Junio C Hamano0430e3a2007-05-15 03:13:17528<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:59529<div class="paragraph"><p>If the commit is a merge, and if the pretty-format
Junio C Hamano0430e3a2007-05-15 03:13:17530is not <em>oneline</em>, <em>email</em> or <em>raw</em>, an additional line is
531inserted before the <em>Author:</em> line. This line begins with
532"Merge: " and the sha1s of ancestral commits are printed,
533separated by spaces. Note that the listed commits may not
534necessarily be the list of the <strong>direct</strong> parent commits if you
535have limited your view of history: for example, if you are
536only interested in changes related to a certain directory or
Junio C Hamanoba4b9282008-07-06 05:20:31537file.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:59538<div class="paragraph"><p>There are several built-in formats, and you can define
Junio C Hamanoa574a092010-06-13 19:57:10539additional formats by setting a pretty.&lt;name&gt;
540config option to either another format name, or a
541<em>format:</em> string, as described below (see
542<a href="git-config.html">git-config(1)</a>). Here are the details of the
543built-in formats:</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:59544<div class="ulist"><ul>
Junio C Hamanoa340aaa2006-11-23 02:47:33545<li>
546<p>
547<em>oneline</em>
548</p>
549<div class="literalblock">
550<div class="content">
551<pre><tt>&lt;sha1&gt; &lt;title line&gt;</tt></pre>
552</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:59553<div class="paragraph"><p>This is designed to be as compact as possible.</p></div>
Junio C Hamanoa340aaa2006-11-23 02:47:33554</li>
555<li>
556<p>
557<em>short</em>
558</p>
559<div class="literalblock">
560<div class="content">
561<pre><tt>commit &lt;sha1&gt;
562Author: &lt;author&gt;</tt></pre>
563</div></div>
564<div class="literalblock">
565<div class="content">
566<pre><tt>&lt;title line&gt;</tt></pre>
567</div></div>
568</li>
569<li>
570<p>
571<em>medium</em>
572</p>
573<div class="literalblock">
574<div class="content">
575<pre><tt>commit &lt;sha1&gt;
576Author: &lt;author&gt;
Junio C Hamano6a3c8272008-12-19 21:38:18577Date: &lt;author date&gt;</tt></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:33578</div></div>
579<div class="literalblock">
580<div class="content">
581<pre><tt>&lt;title line&gt;</tt></pre>
582</div></div>
583<div class="literalblock">
584<div class="content">
585<pre><tt>&lt;full commit message&gt;</tt></pre>
586</div></div>
587</li>
588<li>
589<p>
590<em>full</em>
591</p>
592<div class="literalblock">
593<div class="content">
594<pre><tt>commit &lt;sha1&gt;
595Author: &lt;author&gt;
596Commit: &lt;committer&gt;</tt></pre>
597</div></div>
598<div class="literalblock">
599<div class="content">
600<pre><tt>&lt;title line&gt;</tt></pre>
601</div></div>
602<div class="literalblock">
603<div class="content">
604<pre><tt>&lt;full commit message&gt;</tt></pre>
605</div></div>
606</li>
607<li>
608<p>
609<em>fuller</em>
610</p>
611<div class="literalblock">
612<div class="content">
613<pre><tt>commit &lt;sha1&gt;
Junio C Hamano6a3c8272008-12-19 21:38:18614Author: &lt;author&gt;
Junio C Hamanoba4b9282008-07-06 05:20:31615AuthorDate: &lt;author date&gt;
Junio C Hamano6a3c8272008-12-19 21:38:18616Commit: &lt;committer&gt;
Junio C Hamanoba4b9282008-07-06 05:20:31617CommitDate: &lt;committer date&gt;</tt></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:33618</div></div>
619<div class="literalblock">
620<div class="content">
621<pre><tt>&lt;title line&gt;</tt></pre>
622</div></div>
623<div class="literalblock">
624<div class="content">
625<pre><tt>&lt;full commit message&gt;</tt></pre>
626</div></div>
627</li>
628<li>
629<p>
630<em>email</em>
631</p>
632<div class="literalblock">
633<div class="content">
634<pre><tt>From &lt;sha1&gt; &lt;date&gt;
635From: &lt;author&gt;
Junio C Hamanoba4b9282008-07-06 05:20:31636Date: &lt;author date&gt;
Junio C Hamanoa340aaa2006-11-23 02:47:33637Subject: [PATCH] &lt;title line&gt;</tt></pre>
638</div></div>
639<div class="literalblock">
640<div class="content">
Junio C Hamano0430e3a2007-05-15 03:13:17641<pre><tt>&lt;full commit message&gt;</tt></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:33642</div></div>
643</li>
644<li>
645<p>
646<em>raw</em>
647</p>
Junio C Hamano68cf15a2010-11-06 01:01:59648<div class="paragraph"><p>The <em>raw</em> format shows the entire commit exactly as
Junio C Hamanoa340aaa2006-11-23 02:47:33649stored in the commit object. Notably, the SHA1s are
650displayed in full, regardless of whether --abbrev or
651--no-abbrev are used, and <em>parents</em> information show the
652true parent commits, without taking grafts nor history
Junio C Hamanoba4b9282008-07-06 05:20:31653simplification into account.</p></div>
Junio C Hamanoa340aaa2006-11-23 02:47:33654</li>
Junio C Hamanoa3fd83c2007-03-02 10:34:36655<li>
656<p>
Junio C Hamanoe32ec8b2010-06-02 23:32:31657<em>format:&lt;string&gt;</em>
Junio C Hamanoa3fd83c2007-03-02 10:34:36658</p>
Junio C Hamano68cf15a2010-11-06 01:01:59659<div class="paragraph"><p>The <em>format:&lt;string&gt;</em> format allows you to specify which information
Junio C Hamanoa3fd83c2007-03-02 10:34:36660you want to show. It works a little bit like printf format,
661with the notable exception that you get a newline with <em>%n</em>
Junio C Hamanoba4b9282008-07-06 05:20:31662instead of <em>\n</em>.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:59663<div class="paragraph"><p>E.g, <em>format:"The author of %h was %an, %ar%nThe title was &gt;&gt;%s&lt;&lt;%n"</em>
Junio C Hamanoba4b9282008-07-06 05:20:31664would show something like this:</p></div>
Junio C Hamano0430e3a2007-05-15 03:13:17665<div class="listingblock">
666<div class="content">
667<pre><tt>The author of fe6e0ee was Junio C Hamano, 23 hours ago
Junio C Hamano68cf15a2010-11-06 01:01:59668The title was &gt;&gt;t4119: test autocomputing -p&lt;n&gt; for traditional diff input.&lt;&lt;</tt></pre>
Junio C Hamano0430e3a2007-05-15 03:13:17669</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:59670<div class="paragraph"><p>The placeholders are:</p></div>
671<div class="ulist"><ul>
Junio C Hamanoa3fd83c2007-03-02 10:34:36672<li>
673<p>
674<em>%H</em>: commit hash
675</p>
676</li>
677<li>
678<p>
679<em>%h</em>: abbreviated commit hash
680</p>
681</li>
682<li>
683<p>
684<em>%T</em>: tree hash
685</p>
686</li>
687<li>
688<p>
689<em>%t</em>: abbreviated tree hash
690</p>
691</li>
692<li>
693<p>
694<em>%P</em>: parent hashes
695</p>
696</li>
697<li>
698<p>
699<em>%p</em>: abbreviated parent hashes
700</p>
701</li>
702<li>
703<p>
704<em>%an</em>: author name
705</p>
706</li>
707<li>
708<p>
Junio C Hamano8bc410e2009-02-15 10:38:19709<em>%aN</em>: author name (respecting .mailmap, see <a href="git-shortlog.html">git-shortlog(1)</a> or <a href="git-blame.html">git-blame(1)</a>)
Junio C Hamanof5a93622008-07-16 03:23:57710</p>
711</li>
712<li>
713<p>
Junio C Hamanoa3fd83c2007-03-02 10:34:36714<em>%ae</em>: author email
715</p>
716</li>
717<li>
718<p>
Junio C Hamano8bc410e2009-02-15 10:38:19719<em>%aE</em>: author email (respecting .mailmap, see <a href="git-shortlog.html">git-shortlog(1)</a> or <a href="git-blame.html">git-blame(1)</a>)
720</p>
721</li>
722<li>
723<p>
Junio C Hamanoa387df32008-08-29 08:56:58724<em>%ad</em>: author date (format respects --date= option)
Junio C Hamanoa3fd83c2007-03-02 10:34:36725</p>
726</li>
727<li>
728<p>
729<em>%aD</em>: author date, RFC2822 style
730</p>
731</li>
732<li>
733<p>
734<em>%ar</em>: author date, relative
735</p>
736</li>
737<li>
738<p>
739<em>%at</em>: author date, UNIX timestamp
740</p>
741</li>
742<li>
743<p>
Junio C Hamano02f130b2007-07-14 08:26:56744<em>%ai</em>: author date, ISO 8601 format
745</p>
746</li>
747<li>
748<p>
Junio C Hamanoa3fd83c2007-03-02 10:34:36749<em>%cn</em>: committer name
750</p>
751</li>
752<li>
753<p>
Junio C Hamano8bc410e2009-02-15 10:38:19754<em>%cN</em>: committer name (respecting .mailmap, see <a href="git-shortlog.html">git-shortlog(1)</a> or <a href="git-blame.html">git-blame(1)</a>)
Junio C Hamanof5a93622008-07-16 03:23:57755</p>
756</li>
757<li>
758<p>
Junio C Hamanoa3fd83c2007-03-02 10:34:36759<em>%ce</em>: committer email
760</p>
761</li>
762<li>
763<p>
Junio C Hamano8bc410e2009-02-15 10:38:19764<em>%cE</em>: committer email (respecting .mailmap, see <a href="git-shortlog.html">git-shortlog(1)</a> or <a href="git-blame.html">git-blame(1)</a>)
765</p>
766</li>
767<li>
768<p>
Junio C Hamanoa3fd83c2007-03-02 10:34:36769<em>%cd</em>: committer date
770</p>
771</li>
772<li>
773<p>
774<em>%cD</em>: committer date, RFC2822 style
775</p>
776</li>
777<li>
778<p>
779<em>%cr</em>: committer date, relative
780</p>
781</li>
782<li>
783<p>
784<em>%ct</em>: committer date, UNIX timestamp
785</p>
786</li>
787<li>
788<p>
Junio C Hamano02f130b2007-07-14 08:26:56789<em>%ci</em>: committer date, ISO 8601 format
790</p>
791</li>
792<li>
793<p>
Junio C Hamano5e4d8de2008-09-19 06:27:02794<em>%d</em>: ref names, like the --decorate option of <a href="git-log.html">git-log(1)</a>
795</p>
796</li>
797<li>
798<p>
Junio C Hamanoa3fd83c2007-03-02 10:34:36799<em>%e</em>: encoding
800</p>
801</li>
802<li>
803<p>
804<em>%s</em>: subject
805</p>
806</li>
807<li>
808<p>
Junio C Hamano5f9a6f02009-04-06 08:26:56809<em>%f</em>: sanitized subject line, suitable for a filename
810</p>
811</li>
812<li>
813<p>
Junio C Hamanoa3fd83c2007-03-02 10:34:36814<em>%b</em>: body
815</p>
816</li>
817<li>
818<p>
Junio C Hamanocb39aea2010-05-09 07:24:48819<em>%B</em>: raw body (unwrapped subject and body)
820</p>
821</li>
822<li>
823<p>
Junio C Hamano3b70d3c2009-11-21 17:37:37824<em>%N</em>: commit notes
825</p>
826</li>
827<li>
828<p>
Junio C Hamanoc21ab052009-10-31 04:03:55829<em>%gD</em>: reflog selector, e.g., <tt>refs/stash@{1}</tt>
830</p>
831</li>
832<li>
833<p>
834<em>%gd</em>: shortened reflog selector, e.g., <tt>stash@{1}</tt>
835</p>
836</li>
837<li>
838<p>
839<em>%gs</em>: reflog subject
840</p>
841</li>
842<li>
843<p>
Junio C Hamanoa3fd83c2007-03-02 10:34:36844<em>%Cred</em>: switch color to red
845</p>
846</li>
847<li>
848<p>
849<em>%Cgreen</em>: switch color to green
850</p>
851</li>
852<li>
853<p>
854<em>%Cblue</em>: switch color to blue
855</p>
856</li>
857<li>
858<p>
859<em>%Creset</em>: reset color
860</p>
861</li>
862<li>
863<p>
Junio C Hamanocc0cb312009-01-22 03:38:50864<em>%C(&#8230;)</em>: color specification, as described in color.branch.* config option
865</p>
866</li>
867<li>
868<p>
Junio C Hamanod9e0e5d2007-04-14 16:22:04869<em>%m</em>: left, right or boundary mark
870</p>
871</li>
872<li>
873<p>
Junio C Hamanoa3fd83c2007-03-02 10:34:36874<em>%n</em>: newline
875</p>
Junio C Hamano0430e3a2007-05-15 03:13:17876</li>
Junio C Hamanob78d2592008-04-09 09:39:08877<li>
878<p>
Junio C Hamanoa9701f02010-01-21 00:42:16879<em>%%</em>: a raw <em>%</em>
880</p>
881</li>
882<li>
883<p>
Junio C Hamanob78d2592008-04-09 09:39:08884<em>%x00</em>: print a byte from a hex code
885</p>
886</li>
Junio C Hamanobf984de2009-11-23 06:11:19887<li>
888<p>
889<em>%w([&lt;w&gt;[,&lt;i1&gt;[,&lt;i2&gt;]]])</em>: switch line wrapping, like the -w option of
Junio C Hamano5706e0b2009-11-24 10:54:16890 <a href="git-shortlog.html">git-shortlog(1)</a>.
Junio C Hamanobf984de2009-11-23 06:11:19891</p>
892</li>
Junio C Hamanoba4b9282008-07-06 05:20:31893</ul></div>
Junio C Hamanoa3fd83c2007-03-02 10:34:36894</li>
Junio C Hamanoc21ab052009-10-31 04:03:55895</ul></div>
896<div class="admonitionblock">
897<table><tr>
898<td class="icon">
899<div class="title">Note</div>
900</td>
901<td class="content">Some placeholders may depend on other options given to the
902revision traversal engine. For example, the <tt>%g*</tt> reflog options will
903insert an empty string unless we are traversing reflog entries (e.g., by
904<tt>git log -g</tt>). The <tt>%d</tt> placeholder will use the "short" decoration
905format if <tt>--decorate</tt> was not already provided on the command line.</td>
906</tr></table>
907</div>
Junio C Hamano68cf15a2010-11-06 01:01:59908<div class="paragraph"><p>If you add a <tt>&#43;</tt> (plus sign) after <em>%</em> of a placeholder, a line-feed
Junio C Hamano2bd8a742009-12-01 21:16:59909is inserted immediately before the expansion if and only if the
910placeholder expands to a non-empty string.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:59911<div class="paragraph"><p>If you add a <tt>-</tt> (minus sign) after <em>%</em> of a placeholder, line-feeds that
Junio C Hamano2bd8a742009-12-01 21:16:59912immediately precede the expansion are deleted if and only if the
913placeholder expands to an empty string.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:59914<div class="paragraph"><p>If you add a ` ` (space) after <em>%</em> of a placeholder, a space
Junio C Hamano89a57342010-06-22 23:22:55915is inserted immediately before the expansion if and only if the
916placeholder expands to a non-empty string.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:59917<div class="ulist"><ul>
Junio C Hamano6fb124c2008-06-13 10:04:01918<li>
919<p>
920<em>tformat:</em>
921</p>
Junio C Hamano68cf15a2010-11-06 01:01:59922<div class="paragraph"><p>The <em>tformat:</em> format works exactly like <em>format:</em>, except that it
Junio C Hamano6fb124c2008-06-13 10:04:01923provides "terminator" semantics instead of "separator" semantics. In
924other words, each commit has the message terminator character (usually a
925newline) appended, rather than a separator placed between entries.
926This means that the final entry of a single-line format will be properly
927terminated with a new line, just as the "oneline" format does.
Junio C Hamanoba4b9282008-07-06 05:20:31928For example:</p></div>
Junio C Hamano6fb124c2008-06-13 10:04:01929<div class="listingblock">
930<div class="content">
931<pre><tt>$ git log -2 --pretty=format:%h 4da45bef \
932 | perl -pe '$_ .= " -- NO NEWLINE\n" unless /\n/'
9334da45be
9347134973 -- NO NEWLINE
935
936$ git log -2 --pretty=tformat:%h 4da45bef \
937 | perl -pe '$_ .= " -- NO NEWLINE\n" unless /\n/'
9384da45be
9397134973</tt></pre>
940</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:59941<div class="paragraph"><p>In addition, any unrecognized string that has a <tt>%</tt> in it is interpreted
Junio C Hamano0a235222009-03-06 08:21:09942as if it has <tt>tformat:</tt> in front of it. For example, these two are
943equivalent:</p></div>
944<div class="listingblock">
945<div class="content">
946<pre><tt>$ git log -2 --pretty=tformat:%h 4da45bef
947$ git log -2 --pretty=%h 4da45bef</tt></pre>
948</div></div>
Junio C Hamano6fb124c2008-06-13 10:04:01949</li>
Junio C Hamanoba4b9282008-07-06 05:20:31950</ul></div>
Junio C Hamanod9d71c02006-02-08 00:52:33951</div>
Junio C Hamanoba4b9282008-07-06 05:20:31952<h2 id="_examples">EXAMPLES</h2>
Junio C Hamano7d23f5e2006-12-16 07:44:04953<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:59954<div class="dlist"><dl>
955<dt class="hdlist1">
Junio C Hamano7d23f5e2006-12-16 07:44:04956git show v1.0.0
957</dt>
958<dd>
959<p>
Junio C Hamano775a0f42006-12-31 01:19:14960 Shows the tag <tt>v1.0.0</tt>, along with the object the tags
961 points at.
Junio C Hamano7d23f5e2006-12-16 07:44:04962</p>
963</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59964<dt class="hdlist1">
Junio C Hamanodb911ee2007-02-28 08:13:52965git show v1.0.0^{tree}
Junio C Hamano7d23f5e2006-12-16 07:44:04966</dt>
967<dd>
968<p>
969 Shows the tree pointed to by the tag <tt>v1.0.0</tt>.
970</p>
971</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59972<dt class="hdlist1">
Junio C Hamanoc3fda572010-11-09 19:41:30973git show -s --format=%s v1.0.0^{commit}
974</dt>
975<dd>
976<p>
977 Shows the subject of the commit pointed to by the
978 tag <tt>v1.0.0</tt>.
979</p>
980</dd>
981<dt class="hdlist1">
Junio C Hamanodb911ee2007-02-28 08:13:52982git show next~10:Documentation/README
983</dt>
984<dd>
985<p>
Junio C Hamano7d23f5e2006-12-16 07:44:04986 Shows the contents of the file <tt>Documentation/README</tt> as
987 they were current in the 10th last commit of the branch
Junio C Hamanodb911ee2007-02-28 08:13:52988 <tt>next</tt>.
989</p>
990</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59991<dt class="hdlist1">
Junio C Hamanodb911ee2007-02-28 08:13:52992git show master:Makefile master:t/Makefile
993</dt>
994<dd>
995<p>
Junio C Hamano7d23f5e2006-12-16 07:44:04996 Concatenates the contents of said Makefiles in the head
Junio C Hamanodb911ee2007-02-28 08:13:52997 of the branch <tt>master</tt>.
998</p>
999</dd>
Junio C Hamanoba4b9282008-07-06 05:20:311000</dl></div>
Junio C Hamano7d23f5e2006-12-16 07:44:041001</div>
Junio C Hamanoba4b9282008-07-06 05:20:311002<h2 id="_discussion">Discussion</h2>
Junio C Hamano775a0f42006-12-31 01:19:141003<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:591004<div class="paragraph"><p>At the core level, git is character encoding agnostic.</p></div>
1005<div class="ulist"><ul>
Junio C Hamano775a0f42006-12-31 01:19:141006<li>
1007<p>
1008The pathnames recorded in the index and in the tree objects
1009 are treated as uninterpreted sequences of non-NUL bytes.
1010 What readdir(2) returns are what are recorded and compared
1011 with the data git keeps track of, which in turn are expected
1012 to be what lstat(2) and creat(2) accepts. There is no such
1013 thing as pathname encoding translation.
1014</p>
1015</li>
1016<li>
1017<p>
Junio C Hamano54bf1e22008-12-20 06:30:111018The contents of the blob objects are uninterpreted sequences
Junio C Hamano775a0f42006-12-31 01:19:141019 of bytes. There is no encoding translation at the core
1020 level.
1021</p>
1022</li>
1023<li>
1024<p>
Junio C Hamano54bf1e22008-12-20 06:30:111025The commit log messages are uninterpreted sequences of non-NUL
Junio C Hamano775a0f42006-12-31 01:19:141026 bytes.
1027</p>
1028</li>
Junio C Hamanoba4b9282008-07-06 05:20:311029</ul></div>
Junio C Hamano68cf15a2010-11-06 01:01:591030<div class="paragraph"><p>Although we encourage that the commit log messages are encoded
Junio C Hamano775a0f42006-12-31 01:19:141031in UTF-8, both the core and git Porcelain are designed not to
1032force UTF-8 on projects. If all participants of a particular
1033project find it more convenient to use legacy encodings, git
1034does not forbid it. However, there are a few things to keep in
Junio C Hamanoba4b9282008-07-06 05:20:311035mind.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591036<div class="olist arabic"><ol class="arabic">
Junio C Hamano775a0f42006-12-31 01:19:141037<li>
1038<p>
Junio C Hamano1aa40d22010-01-21 17:46:431039<em>git commit</em> and <em>git commit-tree</em> issues
Junio C Hamano14b76482008-01-05 10:32:261040 a warning if the commit log message given to it does not look
Junio C Hamano775a0f42006-12-31 01:19:141041 like a valid UTF-8 string, unless you explicitly say your
1042 project uses a legacy encoding. The way to say this is to
Junio C Hamano35bb3f62007-02-19 05:35:531043 have i18n.commitencoding in <tt>.git/config</tt> file, like this:
Junio C Hamano775a0f42006-12-31 01:19:141044</p>
1045<div class="listingblock">
1046<div class="content">
Junio C Hamano35bb3f62007-02-19 05:35:531047<pre><tt>[i18n]
Junio C Hamano775a0f42006-12-31 01:19:141048 commitencoding = ISO-8859-1</tt></pre>
1049</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:591050<div class="paragraph"><p>Commit objects created with the above setting record the value
Junio C Hamano35bb3f62007-02-19 05:35:531051of <tt>i18n.commitencoding</tt> in its <tt>encoding</tt> header. This is to
Junio C Hamano775a0f42006-12-31 01:19:141052help other people who look at them later. Lack of this header
Junio C Hamanoba4b9282008-07-06 05:20:311053implies that the commit log message is encoded in UTF-8.</p></div>
Junio C Hamano775a0f42006-12-31 01:19:141054</li>
1055<li>
1056<p>
Junio C Hamano1aa40d22010-01-21 17:46:431057<em>git log</em>, <em>git show</em>, <em>git blame</em> and friends look at the
Junio C Hamanoaa17c7c2008-11-03 04:36:581058 <tt>encoding</tt> header of a commit object, and try to re-code the
1059 log message into UTF-8 unless otherwise specified. You can
Junio C Hamano775a0f42006-12-31 01:19:141060 specify the desired output encoding with
Junio C Hamano35bb3f62007-02-19 05:35:531061 <tt>i18n.logoutputencoding</tt> in <tt>.git/config</tt> file, like this:
Junio C Hamano775a0f42006-12-31 01:19:141062</p>
1063<div class="listingblock">
1064<div class="content">
Junio C Hamano35bb3f62007-02-19 05:35:531065<pre><tt>[i18n]
Junio C Hamano775a0f42006-12-31 01:19:141066 logoutputencoding = ISO-8859-1</tt></pre>
1067</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:591068<div class="paragraph"><p>If you do not have this configuration variable, the value of
Junio C Hamanoba4b9282008-07-06 05:20:311069<tt>i18n.commitencoding</tt> is used instead.</p></div>
Junio C Hamano775a0f42006-12-31 01:19:141070</li>
Junio C Hamanoba4b9282008-07-06 05:20:311071</ol></div>
Junio C Hamano68cf15a2010-11-06 01:01:591072<div class="paragraph"><p>Note that we deliberately chose not to re-code the commit log
Junio C Hamano775a0f42006-12-31 01:19:141073message when a commit is made to force UTF-8 at the commit
1074object level, because re-coding to UTF-8 is not necessarily a
Junio C Hamanoba4b9282008-07-06 05:20:311075reversible operation.</p></div>
Junio C Hamano775a0f42006-12-31 01:19:141076</div>
Junio C Hamanoba4b9282008-07-06 05:20:311077<h2 id="_git">GIT</h2>
Junio C Hamanod9d71c02006-02-08 00:52:331078<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:591079<div class="paragraph"><p>Part of the <a href="git.html">git(1)</a> suite</p></div>
Junio C Hamanod9d71c02006-02-08 00:52:331080</div>
1081<div id="footer">
1082<div id="footer-text">
Junio C Hamano5f3d8392011-03-15 23:33:351083Last updated 2011-03-15 23:30:14 UTC
Junio C Hamanod9d71c02006-02-08 00:52:331084</div>
1085</div>
1086</body>
1087</html>